<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>订单支付</title>
    <script type="text/javascript" src="/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="/util.js"></script>
    <script th:inline="javascript">
        $(function(){
            /**
             * 秒杀绑定
             */
            var beginTime = new Date();
            setInterval(function (){
                $("#showTime").text(showTime(beginTime))
            },1000);
        });

        function showTime (beginTime) {
            var nowtime = new Date(); //获取当前时间
            var useTime = nowtime.getTime() - beginTime.getTime();
             var   lefts = Math.floor(useTime/1000%60);  //计算秒数
            return  lefts+"秒";  //返回倒计时的字符串
        }

    </script>
</head>
<body>
    <div id="showTime"></div>
    用户id：<span th:text="${order.userId}"/><br>
    订单号：<span th:text="${order.orderNo}"/><br>
    价格：<span th:text="${order.realPrice}"/>
    <a th:href="@{/order/pay(orderNo=${order.orderNo},seckillId=${seckillId})}">支付</a>
</body>
</html>